home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / OS / FWODUtil / Include / FWFcsSet.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  4.1 KB  |  141 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                FWFcsSet.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FWFCSSET_H
  11. #define FWFCSSET_H
  12.  
  13. #ifndef FWREFCNT_H
  14. #include "FWRefCnt.h"
  15. #endif
  16.  
  17. #ifndef SOM_ODFocusSetIterator_xh
  18. #include <FocusItr.xh>
  19. #endif
  20.  
  21. #if FW_LIB_EXPORT_PRAGMAS
  22. #pragma lib_export on
  23. #endif
  24.  
  25. //========================================================================================
  26. // Forward class declarations
  27. //========================================================================================
  28.  
  29. class FW_CLASS_ATTR ODFocusSet;
  30. class FW_CLASS_ATTR ODSession;
  31. class FW_CLASS_ATTR FW_CFocusSetRep;
  32.  
  33. //========================================================================================
  34. //    class FW_CFocusSet
  35. //========================================================================================
  36.  
  37. class FW_CFocusSet FW_AUTO_DESTRUCT_OBJECT
  38. {
  39. //----------------------------------------------------------------------------------------
  40. //    Constructor(s)/Destructor
  41. //
  42. public:
  43.     FW_CFocusSet(Environment* ev, ODSession* session);
  44.     FW_CFocusSet(const FW_CFocusSet& focusSet);
  45.     
  46.     virtual ~FW_CFocusSet();
  47.  
  48. //----------------------------------------------------------------------------------------
  49. //    New API
  50. //
  51. public:
  52.     void                    Add(Environment* ev, ODTypeToken focus);
  53.     void                    Remove(Environment* ev, ODTypeToken focus);
  54.     
  55.     FW_Boolean                Contains(Environment* ev, ODTypeToken focus) const;
  56.     unsigned short            Count(Environment* ev) const
  57.                                 {return fFociCount;}
  58.                     
  59. //----------------------------------------------------------------------------------------
  60. //    For Internal use
  61. //
  62. public:
  63.     void                    RelinquishFocusSet(Environment* ev, ODFrame* frame) const;
  64.     FW_Boolean                RequestFocusSet(Environment* ev, ODFrame* frame) const;
  65.     ODFocusSetIterator*        CreateFocusSetIterator(Environment* ev) const;
  66.  
  67.     void                    CopyIfShared(Environment* ev);
  68.     
  69. //----------------------------------------------------------------------------------------
  70. //    operators
  71. //
  72. public:
  73.     FW_CFocusSet&             operator=(const FW_CFocusSet& focusSet);
  74.     
  75. //----------------------------------------------------------------------------------------
  76. //    Data Member
  77. //
  78. private:
  79.     unsigned short            fFociCount;
  80.      ODSession*                fSession;
  81.      FW_CFocusSetRep*        fFocusSetRep;
  82. };
  83.  
  84. //========================================================================================
  85. // CLASS FW_CCountedPtrRep
  86. //========================================================================================
  87.  
  88. class FW_CLASS_ATTR FW_CFocusSetRep : public FW_MRefCount
  89. {
  90.     friend class FW_CLASS_ATTR FW_CFocusSet;
  91.     
  92. //----------------------------------------------------------------------------------------
  93. //    Constructor(s)/Destructor
  94. //
  95. public:
  96.     FW_CFocusSetRep(Environment* ev, ODSession* session);    
  97.     virtual ~FW_CFocusSetRep();
  98.                     
  99. //----------------------------------------------------------------------------------------
  100. //    New API
  101. //
  102. protected:
  103.     ODFocusSet*                fODFocusSet;
  104. };
  105.  
  106. //========================================================================================
  107. //    class FW_CFocusSetIterator
  108. //========================================================================================
  109.  
  110. class FW_CFocusSetIterator FW_AUTO_DESTRUCT_OBJECT
  111. {
  112. //----------------------------------------------------------------------------------------
  113. //    Constructor(s)/Destructor
  114. //    
  115. public:
  116.     FW_CFocusSetIterator(Environment* ev, const FW_CFocusSet& focusSet);
  117.     ~FW_CFocusSetIterator();
  118.     
  119. //----------------------------------------------------------------------------------------
  120. //    New API
  121. //    
  122. public:
  123.     ODTypeToken         First(Environment* ev)
  124.                             {return fIterator->First(ev);}
  125.     ODTypeToken         Next(Environment* ev)
  126.                             {return fIterator->Next(ev);}
  127.     FW_Boolean             IsNotComplete(Environment* ev)
  128.                             {return fIterator->IsNotComplete(ev);}
  129.  
  130. //----------------------------------------------------------------------------------------
  131. //    Data Member
  132. //    
  133. private:
  134.     ODFocusSetIterator*        fIterator;
  135. };
  136.  
  137. #if FW_LIB_EXPORT_PRAGMAS
  138. #pragma lib_export off
  139. #endif
  140.  
  141. #endif